<?php
/**
 * Created by PhpStorm.
 * User: 76683
 * Date: 2018/7/17
 * Time: 21:39
 */

namespace app\api\validate;


use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'name'=>'require|unique:we_category,name',
        'category_id'=>'require|integer'
    ];

    protected $message = [
      'name.require'=>'申请领域缺失',
        'name.unique'=>'领域已经存在',
        'category_id.require'=>'领域ID缺失',
        'category_id.integer'=>'领域ID错误'
    ];
    protected $scene = [
        'apply'=>['name'],
        'list'=>['category_id'],
    ];
}